Skip to content

Conversation

@ShreyaLaxminarayan
Copy link

Summary:
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure. The incorrect condition:

dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey)

causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey).
This results in ilasm failing to read .snk key files when building TestILAssembly on Big Endian Systems.

Environment:
Architecture: s390x
OS: Ubuntu
Runtime : Mono

cc: @uweigand @giritrivedi @saitama951

Summary
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure.
The incorrect condition:
```
dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey)
```
causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey).
This results in ilasm failing to read .snk key files when building TestILAssembly on big Endian Systems.

Environment:
Architecture: s390x
OS: Ubuntu
Runtime : Mono

cc: @uweigand @giritrivedi @saitama951
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 20, 2025
@huoyaoyuan
Copy link
Member

Introduced in #116203. Do we have strong name coverage in the repo at all?

@huoyaoyuan huoyaoyuan added area-ILTools-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 20, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

@ShreyaLaxminarayan
Copy link
Author

There is only very limited strong-name coverage in the repo, and none for the ilasm key-file reading that #116203 modified.

@ShreyaLaxminarayan
Copy link
Author

@Dotnet-s390x build

@Dotnet-s390x
Copy link

Build Queued..

To cancel the current build, please comment:

@Dotnet-s390x cancel

@Dotnet-s390x
Copy link

Build Successful
Please check the build logs: http://148.100.85.217:8080/job/dotnet-builds/73/console.

@ShreyaLaxminarayan
Copy link
Author

@JulieLeeMSFT @huoyaoyuan The s390x CI is failing because of this, can this be merged?

@huoyaoyuan
Copy link
Member

There are multiple ilasm failures in last CI build, and the build has expired. Can you merge and rerun them to see if they are related?

/cc @jkotas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants